/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MyClass;

import java.util.Random;
import javax.microedition.lcdui.Image;

/**
 *
 * @author HuuTai_it
 */
public class MainShip extends Ship {

    public MainShip (GameManagement gameMng, Image image) throws Exception {

        super(gameMng, image);
        
        Random r = new Random();
        boolean temp = true;
        while(temp) {
            
            int x = Math.abs(r.nextInt() % 10);
            int y = Math.abs(r.nextInt() % 10);
            if(gameMng.element[x][y] == 0 && x > 1 && x < 8 && y > 1 && y < 8) {
                
                setPosition(x * 24, y * 24);
                gameMng.element[x][y] = 3;
                temp = false;
            }
        }
    }
    
}
